home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / misc / Coins.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  979 b   |  47 lines

  1. class classes.misc.Coins
  2. {
  3.    var clip;
  4.    var alpha = 0;
  5.    var num = 0;
  6.    var numT = 0;
  7.    var Name = "coins";
  8.    function Coins()
  9.    {
  10.       this.clip = _root.attachMovie("coins","coinsClip",200100);
  11.       this.clip._x = 18;
  12.       this.clip._y = 566;
  13.       this.clip._alpha = 0;
  14.    }
  15.    function addTo(pnumT)
  16.    {
  17.       this.numT += pnumT;
  18.       _root.stats.coins += pnumT;
  19.       if(pnumT > 0)
  20.       {
  21.          _root.stats.totalCoins += pnumT;
  22.       }
  23.       this.alpha = 130;
  24.    }
  25.    function main()
  26.    {
  27.       this.clip._alpha = this.alpha;
  28.       if(this.num < this.numT)
  29.       {
  30.          this.num = this.num + 1;
  31.          this.clip.num = this.num;
  32.          this.alpha = 100;
  33.       }
  34.       else if(this.num > this.numT)
  35.       {
  36.          this.num = this.num - 1;
  37.          this.clip.num = this.num;
  38.          this.alpha = 100;
  39.       }
  40.       this.alpha -= 2;
  41.       if(this.alpha < 0)
  42.       {
  43.          this.alpha = 0;
  44.       }
  45.    }
  46. }
  47.